package dao

// 这是 SmsHomeNewProduct 的全局公开dao对象，被service层调用!
var SmsHomeNewProductDao = smsHomeNewProductDao{}

// 这是 sms_home_new_product表 的实体类
type SmsHomeNewProduct struct {
	Id              int64  `json:"id" form:"id"` // 编号
	ProductId       int64  `json:"product_id" form:"product_id"`
	ProductName     string `json:"product_name" form:"product_name"`
	RecommendStatus int32  `json:"recommend_status" form:"recommend_status"`
	Sort            int32  `json:"sort" form:"sort"`
}

// 注意:这是 SmsHomeNewProduct 的私有dao对象，只能在dao层内使用!
type smsHomeNewProductDao struct {
	InsertTemplate        func(arg []SmsHomeNewProduct) (int64, error)
	UpdateTemplate        func(id int64, sort int32) (int64, error)               `args:"id,sort"` //修改推荐排序
	Delete                func(ids []int64) (int64, error)                        `args:"ids"`
	UpdateRecommendStatus func(ids []int64, RecommendStatus int32) (int64, error) `args:"ids,recommend_status"` //批量修改推荐状态
	List                  func(arg SmsHomeNewProductList) ([]SmsHomeNewProduct, error)
}

type SmsHomeNewProductList struct {
	ProductName     string `json:"product_name" form:"product_name"`
	RecommendStatus int32  `json:"recommend_status" form:"recommend_status"`
	PageNum         int    `json:"page_num" form:"page_num"`
	PageSize        int    `json:"page_size" form:"page_size"`
}

// 添加首页推荐品牌
type SmsHomeNewProductReq struct {
	List []SmsHomeNewProduct `json:"list"`
}
